const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  devServer: {
    port: 8081,
    open: true,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: process.env.VUE_APP_API_SERVER,
        changeOrigin: true,
        pathRewrite: {
          // 不要重写路径，保留/api前缀
          // ['^' + process.env.VUE_APP_BASE_API]: ''
        }
      }
    }
  },
  transpileDependencies: ['@antv/g6', '@antv/util', '@antv/matrix', '@antv/algorithm', 'ml-matrix'],
  configureWebpack: {
    resolve: {
      fallback: {
        util: false
      }
    }
  }
})
